home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib.fmt / tcl / Tcl_AssembleCmd.man < prev    next >
Encoding:
Text File  |  1991-04-20  |  3.8 KB  |  135 lines

  1.  
  2.  
  3.  
  4. Tcl_AssembleCmd   Tcl Command Language Library    Tcl_AssembleCmd
  5.  
  6.  
  7.  
  8. _________________________________________________________________
  9.  
  10. NNAAMMEE
  11.      Tcl_CreateCmdBuf, Tcl_AssembleCmd, Tcl_DeleteCmdBuf - buffer
  12.      pieces of Tcl commands
  13.  
  14. SSYYNNOOPPSSIISS
  15.      ##iinncclluuddee <<ttccll..hh>>
  16.  
  17.      Tcl_CmdBuf
  18.      TTccll__CCrreeaatteeCCmmddBBuuff()
  19.  
  20.      TTccll__DDeelleetteeCCmmddBBuuff(_b_u_f_f_e_r)
  21.  
  22.      char *
  23.      TTccll__AAsssseemmbblleeCCmmdd(_b_u_f_f_e_r, _s_t_r_i_n_g)
  24.  
  25. AARRGGUUMMEENNTTSS
  26.      Tcl_CmdBuf   _b_u_f_f_e_r     (in)      Token for a command buffer
  27.                                        (the result of some previ-
  28.                                        ous        call         to
  29.                                        TTccll__CCrreeaatteeCCmmddBBuuff).
  30.  
  31.      char         *_s_t_r_i_n_g    (in)      Additional piece  of  com-
  32.                                        mand  input to be added to
  33.                                        anything  currently   buf-
  34.                                        fered.
  35.  
  36. _________________________________________________________________
  37.  
  38.  
  39. DDEESSCCRRIIPPTTIIOONN
  40.      These three procedures provide a  convenient  mechanism  for
  41.      assembling  Tcl  commands from an input source where command
  42.      boundaries are not obvious.  For example, if input is  being
  43.      read  from  a  terminal,  a user may type commands that span
  44.      multiple lines.  In situations  like  this,  TTccll__AAsssseemmbblleeCCmmdd
  45.      can  be  called  with  the  individual  lines  as  they  are
  46.      received.  It buffers the lines internally and returns  full
  47.      commands when they are complete.
  48.  
  49.      A command buffer is created by calling TTccll__CCrreeaatteeCCmmddBBuuff, and
  50.      it is deleted by calling TTccll__DDeelleetteeCCmmddBBuuff.  There may be any
  51.      number of command buffers for a particular program  or  even
  52.      for a particular interpreter;  in most cases there should be
  53.      one buffer for each independent source of command input.
  54.  
  55.      When  input  arrives  from  a   source   you   should   call
  56.      TTccll__AAsssseemmbblleeCCmmdd,  passing  it  the  new  input as the _s_t_r_i_n_g
  57.      argument.  TTccll__AAsssseemmbblleeCCmmdd will add the new  input  to  any-
  58.      thing  currently buffered in _b_u_f_f_e_r.  If the information now
  59.      buffered represents a complete Tcl command (i.e.  the  whole
  60.      command  ends  with  a  newline  character  and there are no
  61.      unmatched quotes, braces, or brackets), then TTccll__AAsssseemmbblleeCCmmdd
  62.  
  63.  
  64.  
  65. Sprite v.1.0        Printed:  April 19, 1991                    1
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72. Tcl_AssembleCmd   Tcl Command Language Library    Tcl_AssembleCmd
  73.  
  74.  
  75.  
  76.      returns  a  pointer to the complete command and arranges for
  77.      the  buffer  to   be   cleared   on   the   next   call   to
  78.      TTccll__AAsssseemmbblleeCCmmdd.    If   the  command  is  still  incomplete
  79.      (because, for example,  there  are  unmatched  braces)  then
  80.      TTccll__AAsssseemmbblleeCCmmdd   returns  NULL.   TTccll__AAsssseemmbblleeCCmmdd  keeps  a
  81.      private copy of the command being  assembled,  so  that  the
  82.      caller  need  not  preserve  the  contents of _s_t_r_i_n_g between
  83.      calls to TTccll__AAsssseemmbblleeCCmmdd.  TTccll__AAsssseemmbblleeCCmmdd supports commands
  84.      of arbitrary length (up to the total memory limit imposed by
  85.      the operating system, if any).
  86.  
  87.  
  88. KKEEYYWWOORRDDSS
  89.      assemble, buffer, partial command
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131. Sprite v.1.0        Printed:  April 19, 1991                    2
  132.  
  133.  
  134.  
  135.